<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/template.xhtml">
	<ui:define name="content">
		<p>
			<h:outputFormat value="#{kullanicibundle.sayfa_aciklama}"/>
		</p>
		<p:panel header="#{kullanicibundle.giris_panel_header}" id="bilgiGirisPanel"
			styleClass="marginTop15">
			<h:outputScript library="js" name="document_ready.js" />
			<p:panelGrid columns="2" styleClass="zebra"
				columnClasses="confirmCol1,confirmCol2">
				<h:outputText value="#{kullanicibundle.lbl_ad}" />
				<p:inputText value="#{kullaniciBean.ad}" />
				<h:outputText value="#{kullanicibundle.lbl_soyad}" />
				<p:inputText value="#{kullaniciBean.soyad}" />
				<h:outputText value="#{kullanicibundle.lbl_mail}" />
				<p:inputText id="mail" value="#{kullaniciBean.mail}" />
				<h:outputText value="#{kullanicibundle.lbl_sifre}" />
				<p:password id="sifre" value="#{kullaniciBean.sifre}" />
				<h:outputText value="#{kullanicibundle.lbl_sifre_tekrar}" />
				<p:password id="sifreTekrar" value="#{kullaniciBean.sifreTekrar}" />
				<h:outputText value="#{kullanicibundle.lbl_rol}" />
				<p:selectOneMenu id="role" value="#{kullaniciBean.roleId}">
					<f:selectItem itemLabel="#{appbundle.lbl_seciniz}" itemValue="" />
					<f:selectItems value="#{kullaniciBean.roles}" />
				</p:selectOneMenu>
			</p:panelGrid>
		</p:panel>

		<h:panelGroup id="buttonsPanel2">
			<div class="btnRightCol marginTop7">
				<p:commandButton value="#{appbundle.btn_iptal}" action="#{roleBean.cancelAction()}"
					update=":bodyForm:bilgiGirisPanel" styleClass="btn100" />
				<p:commandButton value="#{appbundle.btn_tamam}"
					action="#{kullaniciBean.saveAction()}" update="@form"
					styleClass="btn100" />
			</div>
		</h:panelGroup>


		<p:panel id="datalistPanel" header="#{kullanicibundle.data_table_header}"
			styleClass="marginTop15">
			<p:dataTable var="kullanici"
				value="#{kullaniciBean.list}"
				paginator="#{kullaniciBean.list.size() > 10}"
				paginatorPosition="bottom" rows="10">

				<p:column>
					<f:facet name="header">
						<h:outputText value="#{kullanicibundle.lbl_ad}" />
					</f:facet>
					<h:outputText rendered="#{not empty kullanici.ad}"
						value="#{kullanici.ad}" />
					<h:outputText rendered="#{empty kullanici.ad}"
						value="#{appbundle.lbl_tire}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{kullanicibundle.lbl_soyad}" />
					</f:facet>
					<h:outputText value="#{kullanici.soyad}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{kullanicibundle.lbl_mail}" />
					</f:facet>
					<h:outputText value="#{kullanici.mail}" />
				</p:column>
				<p:column>
					<f:facet name="header">
						<h:outputText value="#{kullanicibundle.lbl_rol}" />
					</f:facet>
					<h:outputText value="#{kullanici.pysRole.ad}" />
				</p:column>

				<p:column style="width:25px;text-align: center">
					<p:commandLink action="#{kullaniciBean.updateAction()}"
						update=":bodyForm:bilgiGirisPanel">
						<p:graphicImage value="/resources/images/icons/pencil.png" />
						<f:setPropertyActionListener value="#{kullanici}"
							target="#{kullaniciBean.selectedKullanici}" />
					</p:commandLink>
				</p:column>
				<p:column style="width:25px;text-align: center">
					<p:commandLink action="#{kullaniciBean.deleteAction()}"
						update="@form">
						<p:graphicImage value="/resources/images/icons/cross.png" />
						<f:setPropertyActionListener value="#{kullanici}"
							target="#{kullaniciBean.selectedKullanici}" />
					</p:commandLink>
				</p:column>
			</p:dataTable>
		</p:panel>
	</ui:define>
</ui:composition>
</html>
